var carId;
var rcrdDate;
var showEleDetail;
require(['grid', 'topBar', 'layout', 'date'], function () {
    accept=function(_carId,_rcrdDate){
    	carId=_carId;
    	rcrdDate=_rcrdDate;
    	showEleDetail();
    }
    function gridInit() {
    	$('#grid').grid({
    		url : "/deviceOnline/offLineRateDetailed.htm",
    		multiselect:false,
    		height: 450,
    		width: 1000,
    		colModel:[
    			{name: "licPltNo", label:"车牌号" },
    			{name: "rcrdDate", label:"数据日期"},
    			{name: "task", label:"任务",width:80},
    			{name: "opertaionOnlineTime",label:"在线总时间"},
    			{name: "opertaionTotalTime",label:"运营总时间"},
    			{name: "offlineRate",label:"离线率"},
    	        ]
    		});
    }
    
    
    showEleDetail = function (data) {
    	var params={};
    	params.carId = carId;
    	params.rcrdDate = rcrdDate;
		
		$('#grid').grid('setGridParam', {
			page: 1,
			datatype: "json",
			postData: params
		}).trigger("reloadGrid");
	}
    $('body').layout();
	//初始化grid
	gridInit();
    
});